home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 20 Aug 1996
- // Author: jb
- //
- //
- // Procedure Name:
- // OutlinerEdMenu
- //
- // Description:
- // Creates a popup menu for the outliner, that
- // allows for control of outliner display
- //
- // Input Arguments:
- // Parent outliner.
- //
- // Return Value:
- // None.
- //
-
- //
- // Procedure Name:
- // setOutlinerLongName
- //
- // Description:
- // Sets the Outliner long/short name flag
- //
- // Input Arguments:
- // state - 0 = short, 1 = nice, 2 = long
- //
- // Return Value:
- // None.
- //
- global proc setOutlinerLongName (int $state, string $outlineEd)
- {
- // Query the current "name" state of the outliner.
- //
- int $longNames = `outlinerEditor -query -longNames $outlineEd`;
- int $niceNames = `outlinerEditor -query -niceNames $outlineEd`;
-
- // Check for a change.
- //
- if ($niceNames && $state == 1) return;
- if (!$niceNames && $longNames && $state == 2) return;
- if (!$niceNames && !$longNames && $state == 0) return;
-
- if( $state == 2 ) {
- outlinerEditor -e -ln true -nn false $outlineEd;
- } else if( $state == 1 ) {
- outlinerEditor -e -ln true -nn true $outlineEd;
- } else {
- outlinerEditor -e -ln false -nn false $outlineEd;
- }
- }
-
- global proc OutlinerEdMenuCommand (string $outlineEd)
- {
- //
- // This is the post command for the Outliner Editor popup menu
-
- setParent -m ($outlineEd+"Popup");
- menuItem -edit
- -checkBox `outlinerEditor -query -showDagOnly $outlineEd`
- dagItem;
- menuItem -edit
- -checkBox `outlinerEditor -query -showShapes $outlineEd`
- shapeItem;
- menuItem -edit
- -checkBox `outlinerEditor -query -showAttributes $outlineEd`
- attributeItem;
- menuItem -edit
- -checkBox `outlinerEditor -query -showSetMembers $outlineEd`
- setMembersItem;
- menuItem -edit
- -checkBox `outlinerEditor -query -showConnected $outlineEd`
- connectedItem;
-
- int $outlinerLongName = 1;
- if (!`outlinerEditor -query -niceNames $outlineEd`) {
- $outlinerLongName = (`outlinerEditor -query -longNames $outlineEd` ? 2 : 0);
- }
- menuItem -edit
- -radioButton ( 1 == $outlinerLongName )
- niceNameItem;
- menuItem -edit
- -radioButton ( 2 == $outlinerLongName )
- longNameItem;
- menuItem -edit
- -radioButton ( 0 == $outlinerLongName )
- shortNameItem;
-
- string $sortOrder = `outlinerEditor -query -sortOrder $outlineEd`;
- menuItem -edit
- -radioButton ($sortOrder == "none")
- noneSortOrderItem;
- menuItem -edit
- -radioButton ($sortOrder == "dagName")
- dagNameSortOrderItem;
- }
-
- global proc OutlinerEdMenuUpdateDragStyle(string $menu, string $outlineEd)
- {
- setParent -m $menu;
- menuItem -e -rb `outlinerEditor -q -dropIsParent $outlineEd` parentModeItem;
- menuItem -e -rb (!`outlinerEditor -q -dropIsParent $outlineEd`) reorderModeItem;
- }
-
- //
- // procedure: switchOutlinerDropStyle
- // switch in the outliner the drag/drop style
- // keep in a global variable the state between different
- // sessions
- //
- global proc int switchOutlinerDropStyle (string $outlineEd)
- {
- return (0);
- }
-
- global proc OutlinerEdMenu (string $outlineEd)
- {
-
- popupMenu
- -ctrlModifier false
- -button 3
- -postMenuCommand ("OutlinerEdMenuCommand " + $outlineEd)
- -parent $outlineEd ($outlineEd+"Popup");
-
- menuItem -label "Show DAG Objects Only"
- -checkBox true
- -command ("outlinerEditor -edit -showDagOnly #1 " + $outlineEd)
- dagItem;
- menuItem -label "Show Shapes"
- -checkBox false
- -command ("outlinerEditor -edit -showShapes #1 " + $outlineEd)
- shapeItem;
- menuItem -label "Show Attributes"
- -checkBox false
- -command ("outlinerEditor -edit -showAttributes #1 " + $outlineEd)
- attributeItem;
- menuItem -label "Show Set Members"
- -checkBox false
- -command ("outlinerEditor -edit -showSetMembers #1 " + $outlineEd)
- setMembersItem;
- menuItem -label "Show Connected"
- -checkBox false
- -command ("outlinerEditor -edit -showConnected #1 " + $outlineEd)
- connectedItem;
- menuItem -divider true;
- menuItem -label "Reveal Selected"
- -command ("outlinerEditor -edit -showSelected 1 " + $outlineEd)
- showSelectedItem;
- int $outlinerLongName = 1;
- if (!`outlinerEditor -query -niceNames $outlineEd`) {
- $outlinerLongName = (`outlinerEditor -query -longNames $outlineEd` ? 2 : 0);
- }
- menuItem -l "Channel Names" -subMenu true;
- radioMenuItemCollection;
- menuItem -l "Nice"
- -radioButton ( 1 == $outlinerLongName )
- -command ("setOutlinerLongName 1 " + $outlineEd)
- niceNameItem;
- menuItem -l "Long"
- -radioButton ( 2 == $outlinerLongName )
- -command ("setOutlinerLongName 2 " + $outlineEd)
- longNameItem;
- menuItem -l "Short"
- -radioButton ( 0 == $outlinerLongName )
- -command ("setOutlinerLongName 0 " + $outlineEd)
- shortNameItem;
- setParent -m ..;
- string $sortOrder = `outlinerEditor -query -sortOrder $outlineEd`;
- menuItem -l "Sort Order" -subMenu true;
- radioMenuItemCollection;
- menuItem -l "Scene Hierarchy"
- -radioButton ($sortOrder == "none")
- -command ("outlinerEditor -edit -sortOrder none " + $outlineEd)
- noneSortOrderItem;
- menuItem -l "Alphabetical Within Type"
- -radioButton ($sortOrder == "dagName")
- -command ("outlinerEditor -edit -sortOrder dagName " + $outlineEd)
- dagNameSortOrderItem;
- setParent -m ..;
- menuItem -divider true;
- menuItem -l "Select Set Members"
- -command ("selectAllSetMembers " + $outlineEd)
- selectAllSetMembersItem;
- menuItem -divider true;
- }
-
- global proc selectAllSetMembers (string $outliner)
- //
- // Procedure Name:
- // selectAllSetMembers
- //
- // Description:
- // For each set that is selected (gray) in the given Outliner editor,
- // the members of that set are added to the selection list.
- // The sets themselves are not added to the selection list, and will
- // be deselected.
- //
- // Input Arguments:
- // The Outliner to get the list of selected sets from.
- //
- // Return Value:
- // None.
- //
-
-
- {
- // Get the selection connection that the given Outliner is using,
- // and get a list of all it's members.
- //
- string $outlinerSelection = `outlinerEditor -query -selectionConnection $outliner`;
- string $selectedObjects[] = `selectionConnection -query -object $outlinerSelection`;
-
- string $currentObject;
-
- for($currentObject in $selectedObjects) {
-
- // If the selected object is a set (a node of type objectSet),
- // then make sure it is deselected and then select its contents instead.
- //
- if(`nodeType $currentObject` == "objectSet") {
- select -noExpand -deselect $currentObject;
- select -add $currentObject;
- }
- }
- }
-
-